package beans;

import entities.ImagesGroup;
import entities.Image;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Stateless
public class ImagesGroupFacade extends AbstractFacade<ImagesGroup> {
    @PersistenceContext(unitName = "ProjetAppliWebPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public ImagesGroupFacade() {
        super(ImagesGroup.class);
    }

    public ImagesGroup create(Image swatch, Image small, Image medium, Image large) {
        ImagesGroup imagesGroup = new ImagesGroup(swatch, small, medium, large);
        create(imagesGroup);
        return imagesGroup;
    }
}